Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-0 vector-toc-not-available vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-0 skin-theme-clientpref-day vector-sticky-header-enabled" lang="de" dir="ltr"><head>
<meta charset="UTF-8">
<title>Component Pascal</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="./_res_/favicon.png">
<link rel="canonical" href="https://de.wikipedia.org/wiki/Component_Pascal"> <link href="./_mw_/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.pygments.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.wikimediamessages.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link href="./_mw_/ext.gadget.citeRef.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.defaultPlainlinks.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.dewikiCommonHide.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.dewikiCommonLayout.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.dewikiCommonStyle.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.dewikiDarkmode.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.dewikiResponsive.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.specialSearch.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="./_mw_/site.styles.css">
<link rel="stylesheet" type="text/css" href="./_mw_/noscript.css">
<link rel="stylesheet" type="text/css" href="./_res_/footer.css">
<link rel="stylesheet" type="text/css" href="./_res_/vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Component_Pascal rootpage-Component_Pascal skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">Component Pascal</span></h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="contentSub">
<div id="mw-content-subtitle"></div>
</div>
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="de" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="de" dir="ltr"><table class="float-right infobox toccolours toptextcells" style="font-size:90%; margin-top:0; width:21em;">

<tbody><tr>
<th colspan="2" class="hintergrundfarbe6" style="font-size:larger;">Component Pascal
</th></tr>




<tr>
<th colspan="2" class="hintergrundfarbe5" style="font-size:105%; text-align:center;">Basisdaten
</th></tr>
<tr>
<td><b><a href="Programmierparadigma" title="Programmierparadigma">Paradigmen</a>:</b>
</td>
<td><a href="Imperative_Programmierung" title="Imperative Programmierung">imperativ</a>, <a href="Modulare_Programmierung" title="Modulare Programmierung">modular</a>, <a href="Objektorientierte_Programmierung" title="Objektorientierte Programmierung">objektorientiert</a>, komponentenorientiert
</td></tr>
<tr>
<td><b>Erscheinungsjahr:</b>
</td>
<td>1990
</td></tr>


<tr>
<td><b>Entwickler:</b>
</td>
<td><a href="Niklaus_Wirth" title="Niklaus Wirth">Niklaus Wirth</a> /<br> <a href="Oberon_microsystems" title="Oberon microsystems">Oberon microsystems</a>
</td></tr>
<tr>
<td><b>Aktuelle&nbsp;<a href="Version_(Software)" title="Version (Software)">Version</a>:</b>
</td>
<td style="white-space:nowrap;">1.5 &nbsp;<small>(2005, Release Candidate 1.6: 2007)</small>
</td></tr>


<tr>
<td><b><a href="Typisierung_(Informatik)" title="Typisierung (Informatik)">Typisierung</a>:</b>
</td>
<td>statisch und dynamisch, stark
</td></tr>
<tr>
<td><b>Wichtige <a href="Implementierung" title="Implementierung">Implementierungen</a>:</b>
</td>
<td><a href="BlackBox_Component_Builder" title="BlackBox Component Builder">BlackBox Component Builder</a>, Gardens Point Component Pascal
</td></tr>




<tr>
<td><b>Beeinflusst von:</b>
</td>
<td><a href="Modula-2" title="Modula-2">Modula-2</a> / <a href="Oberon_(Programmiersprache)" title="Oberon (Programmiersprache)">Oberon</a>
</td></tr>


<tr>
<td><b><a href="Betriebssystem" title="Betriebssystem">Betriebssystem</a>:</b>
</td>
<td><a href="Windows" class="mw-redirect" title="Windows">Windows</a>, Laufzeitsysteme <a href=".Net-Framework" title=".Net-Framework">.Net-Framework</a> und <a href="Java_Virtual_Machine" title="Java Virtual Machine">JVM</a>
</td></tr>
<tr>
<td><b><a href="Lizenz" title="Lizenz">Lizenz</a>:</b>
</td>
<td>frei
</td></tr>
<tr>
<td colspan="2" class="hintergrundfarbe5" style="text-align:center;"><a rel="nofollow" class="external text" href="https://blackboxframework.org">BlackBox Framework</a>
</td></tr></tbody></table>
<p><b>Component Pascal</b> ist eine seit 2004 kostenlose, seit <a href="1990" title="1990">1990</a> entwickelte, <a href="Imperative_Programmiersprache" class="mw-redirect" title="Imperative Programmiersprache">imperative</a>, <a href="Modul_(Software)" title="Modul (Software)">modulare</a>, <a href="Objektorientiert" class="mw-redirect" title="Objektorientiert">objekt-</a> und <a href="Komponente_(Software)" class="mw-redirect" title="Komponente (Software)">komponentenorientierte</a> <a href="Programmiersprache" title="Programmiersprache">Programmiersprache</a> für das von <a href="Oberon_microsystems" title="Oberon microsystems">Oberon microsystems</a> entwickelte, komponentenbasierte <a href="Entwicklungssystem" class="mw-redirect" title="Entwicklungssystem">Entwicklungssystem</a> <a href="BlackBox_Component_Builder" title="BlackBox Component Builder">BlackBox Component Builder</a>. Inzwischen gibt es unter dem Namen Gardens Point Component Pascal auch Versionen, die unter dem <a href=".Net-Framework" title=".Net-Framework">.Net-Framework</a> und unter der <a href="Java_Virtual_Machine" title="Java Virtual Machine">Java Virtual Machine</a> lauffähig sind.
</p><p>Component Pascal ist aus der Programmiersprache <a href="Oberon_(Programmiersprache)" title="Oberon (Programmiersprache)">Oberon</a> entwickelt worden und firmierte bei der Veröffentlichung 1994 noch unter dem Namen Oberon/L. Das dazugehörende Framework wurde Oberon/F genannt. Mit dem Release 1.3 (das etwa zum Jahreswechsel 1996/1997 freigegeben wurde) wurde aus der Sprache Oberon/L Component Pascal und aus dem Framework Oberon/F der BlackBox Component Builder.
</p><p>Seit 2019 findet keine wesentliche Entwicklung mehr von Component Pascal statt.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p>

<div class="mw-heading mw-heading2"><h2 id="Eigenschaften">Eigenschaften</h2></div>
<p>Component Pascal hat eine ausgesprochen kurze und einfache Sprachbeschreibung mit einer vollständig strukturierten <a href="Syntax" title="Syntax">Syntax</a>. Sie erlaubt <a href="Statische_Typisierung" title="Statische Typisierung">statische Typen</a> und <a href="Objekt_(Programmierung)" title="Objekt (Programmierung)">Objekte</a> genauso wie <a href="Dynamische_Typisierung" title="Dynamische Typisierung">dynamische Typen</a>, sowie <a href="Dynamische_Bindung" title="Dynamische Bindung">dynamische Bindung</a>. Es handelt sich um eine sehr <a href="Starke_Typisierung" title="Starke Typisierung">stark typisierte</a> und <a href="Typsicherheit" title="Typsicherheit">typsichere</a> Programmiersprache, solange das Modul <i>SYSTEM</i> nicht explizit importiert wird, was in der Regel nur für <a href="Systemprogrammierung" title="Systemprogrammierung">Systemprogrammierung</a> vorgesehen ist, und ist daher leicht <a href="Plattformunabh%C3%A4ngigkeit" title="Plattformunabhängigkeit">portabel</a>. <a href="Vererbung_(Programmierung)" title="Vererbung (Programmierung)">Vererbung</a> ist in der Programmiersprache verankert, nicht jedoch <a href="Vererbung_(Programmierung)#Mehrfachvererbung" title="Vererbung (Programmierung)">mehrfache Vererbung</a>, um zusätzliche Belastung für die <a href="Compiler" title="Compiler">Compiler</a> zu vermeiden und die <a href="Formale_Semantik" title="Formale Semantik">Sprachsemantik</a> so eindeutig wie möglich zu gestalten und das <a href="Diamond-Problem" title="Diamond-Problem">Diamond-Problem</a> zu vermeiden.
</p><p>Component Pascal unterstützt auch zur <a href="Laufzeit_(Informatik)" title="Laufzeit (Informatik)">Laufzeit</a> <a href="Automatische_Speicherbereinigung" class="mw-redirect" title="Automatische Speicherbereinigung">automatische Speicherbereinigung</a> und <a href="Linker_(Computerprogramm)#Dynamisches_Linken" title="Linker (Computerprogramm)">dynamisches Laden und Entfernen</a> von <a href="Modul_(Software)" title="Modul (Software)">Modulen</a> respektive <a href="Komponente_(Software)" class="mw-redirect" title="Komponente (Software)">Komponenten</a>, auch während <a href="Objekt_(Programmierung)" title="Objekt (Programmierung)">Instanzen</a> bereits existieren und weiterverwendet werden sollen.
</p><p>Darüber hinaus erlaubt Component Pascal <a href="Assertion_(Informatik)" title="Assertion (Informatik)">Assertionen</a>, <a href="Generische_Programmierung" title="Generische Programmierung">generische Programmierung</a> und das <a href="%C3%9Cberschreiben_(Programmierung)" title="Überschreiben (Programmierung)">Überschreiben</a> von Datentypen und somit auch <a href="Methode_(objektorientierte_Programmierung)" class="mw-redirect" title="Methode (objektorientierte Programmierung)">Methoden</a> (sogenannte typengebundene <a href="Prozedur_(Programmierung)" title="Prozedur (Programmierung)">Prozeduren</a>). Im Sinne der Einfachheit und besseren Nachvollziehbarkeit des Quellcodes ist das <a href="%C3%9Cberladen" title="Überladen">Überladen</a> von Operatoren oder Methoden jedoch nicht möglich.
</p><p>Die Programmiersprache Component Pascal und das Entwicklungs- und Laufzeitsystem <i>BlackBox Component Builder</i> sind seit 2005 <a href="Open_Source" title="Open Source">quelloffen</a>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Einsatzgebiete">Einsatzgebiete</h2></div>
<p>Component Pascal zeichnet sich durch seine geringen Ansprüche an die <a href="Hardware" title="Hardware">Hardware</a>, hohe Stabilität, <a href="Einfachheit" title="Einfachheit">Einfachheit</a> und Schnelligkeit sowohl bei der <a href="Laufzeit_(Informatik)" title="Laufzeit (Informatik)">Laufzeit</a> als auch bei der <a href="Softwaretechnik" title="Softwaretechnik">Softwareentwicklung</a> aus. Es wird vor allem für <a href="Wissenschaftlich" class="mw-redirect" title="Wissenschaftlich">wissenschaftliche</a> und <a href="Technisch" class="mw-redirect" title="Technisch">technische</a> Anwendungen, in <a href="Lehren" title="Lehren">Lehre</a> und <a href="Forschung" title="Forschung">Forschung</a>, aber auch für <a href="Kommerz" title="Kommerz">kommerzielle</a> Anwendungen eingesetzt.
</p>
<div class="mw-heading mw-heading2"><h2 id="Programme">Programme</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Hallo_Welt">Hallo Welt</h3></div>
<div class="mw-heading mw-heading4"><h4 id="Das_Programm_Hallo_Welt_in_Component_Pascal_1._Beispiel">Das Programm <i>Hallo Welt</i> in Component Pascal 1. Beispiel</h4></div>
<p>Im <a href="Modul_(Software)" title="Modul (Software)">Modul</a> <i><a href="Hallo-Welt-Programm" title="Hallo-Welt-Programm">HalloWelt</a></i> wird das (<a href="Parameter_(Informatik)" title="Parameter (Informatik)">parameterlose</a>) <a href="Kommandozeile" title="Kommandozeile">Kommando</a> <i>Output</i> definiert. Der Stern (*) hinter dem <a href="Prozedur_(Programmierung)" title="Prozedur (Programmierung)">Prozedurnamen</a> definiert den Export der Prozedur <i>Output</i>, so dass diese außerhalb des Moduls mit der <a href="Syntax" title="Syntax">Syntax</a> <i>HalloWelt.Output</i> <a href="Referenz_(Programmierung)" title="Referenz (Programmierung)">referenziert</a> werden kann. Der folgende <a href="Quelltext" title="Quelltext">Quelltext</a> stellt ein einfaches Programm dar, das die Meldung <i>Hallo Welt!</i> gefolgt von einem Zeilenumbruch ausgibt:
</p>
<div class="mw-highlight mw-highlight-lang-componentpascal mw-content-ltr" dir="ltr"><pre><span></span> <span class="kr">MODULE</span> <span class="n">HalloWelt</span><span class="p">;</span>

<span class="kr">IMPORT</span> <span class="n">Out</span><span class="p">;</span>

<span class="kr">PROCEDURE</span> <span class="n">Output</span><span class="o">*</span><span class="p">;</span>
<span class="kr">BEGIN</span>
<span class="n">Out</span><span class="p">.</span><span class="n">Open</span><span class="p">;</span>
<span class="n">Out</span><span class="p">.</span><span class="n">String</span> <span class="p">(</span><span class="s">"Hallo Welt!"</span><span class="p">);</span>
<span class="n">Out</span><span class="p">.</span><span class="n">Ln</span><span class="p">;</span>
<span class="kr">END</span> <span class="n">Output</span><span class="p">;</span>

<span class="kr">END</span> <span class="n">HalloWelt</span><span class="p">.</span>
</pre></div>
<div class="mw-heading mw-heading4"><h4 id="Das_Programm_Hallo_Welt_in_Component_Pascal_2._Beispiel">Das Programm <i>Hallo Welt</i> in Component Pascal 2. Beispiel</h4></div>
<p>Im <a href="Modul_(Software)" title="Modul (Software)">Modul</a> <i>HalloWelt2</i> wird eine Variable definiert, die später in einer Dialogbox ausgegeben wird. Der Stern (*) hinter dem <a href="Prozedur_(Programmierung)" title="Prozedur (Programmierung)">Prozedurnamen</a> definiert den Export der Prozedur <i>Output</i>, so dass diese außerhalb des Moduls mit der <a href="Syntax" title="Syntax">Syntax</a> <i>HalloWelt.Output</i> <a href="Referenz_(Programmierung)" title="Referenz (Programmierung)">referenziert</a> werden kann. Der folgende <a href="Quelltext" title="Quelltext">Quelltext</a> stellt ein einfaches Programm dar, das die Meldung <i>Hallo Welt!</i> in einer Dialogbox ausgibt, die über "IMPORT Dialog;" importiert wurde. In der Dialogbox werden u.&nbsp;a. alle mit einem * gekennzeichneten Variablen ausgegeben. Mit "VAR ausgabe*: ARRAY 50 OF CHAR" wird festgelegt, dass eine <code>VAR</code> Variable "ausgabe" angelegt werden soll, die 1.&nbsp;im Dialog sichtbar ist (<code>*</code>) und 2.&nbsp;aus einer Aneinanderreihung von 50 Schriftzeichen besteht (ARRAY 50 OF CHAR)
Durch die Zeile "Dialog.UpdateString(ausgabe);" wird angeordnet, dass der Inhalt der Variable "ausgabe" der Dialogbox zugewiesen wird und sofort angezeigt wird.:
</p>
<div class="mw-highlight mw-highlight-lang-componentpascal mw-content-ltr" dir="ltr"><pre><span></span> <span class="kr">MODULE</span> <span class="n">HalloWelt2</span><span class="p">;</span>

<span class="kr">IMPORT</span> <span class="n">Dialog</span><span class="p">;</span>

<span class="kr">VAR</span> <span class="n">ausgabe</span><span class="o">*</span><span class="p">:</span> <span class="kr">ARRAY</span> <span class="mi">50</span> <span class="kr">OF</span> <span class="kt">CHAR</span><span class="p">;</span>

<span class="kr">PROCEDURE</span> <span class="n">Output</span><span class="o">*</span><span class="p">;</span>
<span class="kr">BEGIN</span>
<span class="n">ausgabe</span><span class="p">:</span><span class="o">=</span> <span class="s">"Hallo Welt!"</span> <span class="p">;</span>
<span class="n">Dialog</span><span class="p">.</span><span class="n">UpdateString</span><span class="p">(</span><span class="n">ausgabe</span><span class="p">);</span>
<span class="kr">END</span> <span class="n">Output</span><span class="p">;</span>

<span class="kr">END</span> <span class="n">HalloWelt2</span><span class="p">.</span>
</pre></div>
<div class="mw-heading mw-heading3"><h3 id="Rechner">Rechner</h3></div>
<div class="mw-heading mw-heading4"><h4 id="Das_Programm_Additions-Rechner_in_Component_Pascal_1._Beispiel">Das Programm <i>Additions-Rechner</i> in Component Pascal 1. Beispiel</h4></div>
<div class="mw-highlight mw-highlight-lang-componentpascal mw-content-ltr" dir="ltr"><pre><span></span> <span class="kr">MODULE</span> <span class="n">Kurs10Rechner</span><span class="p">;</span>
<span class="kr">IMPORT</span> <span class="n">Dialog</span><span class="p">;</span>

<span class="kr">VAR</span> <span class="n">zahl1</span><span class="o">*</span><span class="p">,</span> <span class="n">zahl2</span><span class="o">*</span><span class="p">,</span> <span class="n">ergebnis</span><span class="o">*</span><span class="p">:</span> <span class="kt">INTEGER</span><span class="p">;</span>

<span class="kr">PROCEDURE</span> <span class="n">add</span><span class="o">*</span><span class="p">;</span>
<span class="kr">BEGIN</span>
<span class="n">ergebnis</span> <span class="p">:</span><span class="o">=</span> <span class="p">(</span><span class="n">zahl1</span> <span class="o">+</span> <span class="n">zahl2</span><span class="p">);</span>
<span class="n">Dialog</span><span class="p">.</span><span class="n">UpdateInt</span> <span class="p">(</span><span class="n">ergebnis</span><span class="p">);</span>
<span class="kr">END</span> <span class="n">add</span><span class="p">;</span>

<span class="kr">END</span> <span class="n">Kurs10Rechner</span><span class="p">.</span>
</pre></div>
<div class="mw-heading mw-heading2"><h2 id="Beispiele_für_die_Implementierung_von_Vererbung"><span id="Beispiele_f.C3.BCr_die_Implementierung_von_Vererbung"></span>Beispiele für die Implementierung von Vererbung</h2></div>
<p>Die <a href="Implementierung" title="Implementierung">Implementierung</a> von vererbbaren Strukturen ist bei Component Pascal gegenüber seinem Vorgänger <a href="Oberon_(Programmiersprache)" title="Oberon (Programmiersprache)">Oberon</a> etwas vereinfacht und noch klarer und sicherer strukturiert worden. Die Bemerkungen zwischen <code>(*</code> und <code>*)</code> dienen zur Erläuterung und werden vom Compiler ignoriert. Beispiele:
</p>
<div class="mw-highlight mw-highlight-lang-componentpascal mw-content-ltr" dir="ltr"><pre><span></span> <span class="kr">MODULE</span> <span class="n">Vererbung1</span><span class="p">;</span>

<span class="kr">TYPE</span> <span class="cm">(* Typendefinitionen *)</span>

<span class="n">GraphischesObjekt</span><span class="o">*</span> <span class="o">=</span> <span class="kr">POINTER</span> <span class="kr">TO</span> <span class="kr">ABSTRACT</span> <span class="kr">RECORD</span> <span class="n">farbe</span><span class="o">*</span><span class="p">:</span> <span class="kt">INTEGER</span><span class="p">;</span> <span class="kr">END</span><span class="p">;</span>
<span class="n">Punkt</span><span class="o">*</span> <span class="o">=</span> <span class="kr">POINTER</span> <span class="kr">TO</span> <span class="kr">RECORD</span> <span class="p">(</span><span class="n">GraphischesObjekt</span><span class="p">)</span> <span class="n">x</span><span class="o">*</span><span class="p">,</span> <span class="n">y</span><span class="o">*</span><span class="p">:</span> <span class="kt">INTEGER</span><span class="p">;</span> <span class="kr">END</span><span class="p">;</span>
<span class="n">Linie</span><span class="o">*</span> <span class="o">=</span> <span class="kr">POINTER</span> <span class="kr">TO</span> <span class="kr">RECORD</span> <span class="p">(</span><span class="n">GraphischesObjekt</span><span class="p">)</span> <span class="n">xStart</span><span class="o">*</span><span class="p">,</span> <span class="n">yStart</span><span class="o">*</span><span class="p">,</span> <span class="n">xEnde</span><span class="o">*</span><span class="p">,</span> <span class="n">yEnde</span><span class="o">*</span><span class="p">:</span> <span class="kt">INTEGER</span><span class="p">;</span> <span class="kr">END</span><span class="p">;</span>

<span class="kr">VAR</span> <span class="cm">(* Variablendefinitionen *)</span>

<span class="n">punkt1</span><span class="p">:</span> <span class="n">Punkt</span><span class="p">;</span>
<span class="n">linie1</span><span class="p">:</span> <span class="n">Linie</span><span class="p">;</span>

<span class="kr">PROCEDURE</span> <span class="p">(</span><span class="n">g</span><span class="p">:</span> <span class="n">GraphischesObjekt</span><span class="p">)</span> <span class="n">Zeichne</span><span class="o">*</span> <span class="p">(),</span> <span class="kr">NEW</span><span class="p">,</span> <span class="kr">EXTENSIBLE</span><span class="p">;</span>
<span class="kr">BEGIN</span>
<span class="cm">(* Leere, erweiterbare Methode *)</span>
<span class="kr">END</span> <span class="n">Zeichne</span><span class="p">;</span>

<span class="kr">PROCEDURE</span> <span class="p">(</span><span class="n">punkt</span><span class="p">:</span> <span class="n">Punkt</span><span class="p">)</span> <span class="n">Zeichne</span><span class="o">*</span> <span class="p">();</span>
<span class="kr">BEGIN</span>
<span class="cm">(* ... *)</span>
<span class="kr">END</span> <span class="n">Zeichne</span><span class="p">;</span>

<span class="kr">PROCEDURE</span> <span class="p">(</span><span class="n">linie</span><span class="p">:</span> <span class="n">Linie</span><span class="p">)</span> <span class="n">Zeichne</span><span class="o">*</span> <span class="p">();</span>
<span class="kr">BEGIN</span>
<span class="cm">(* ... *)</span>
<span class="kr">END</span> <span class="n">Zeichne</span><span class="p">;</span>

<span class="kr">BEGIN</span>

<span class="kr">NEW</span> <span class="p">(</span><span class="n">punkt1</span><span class="p">);</span>
<span class="n">punkt1</span><span class="p">.</span><span class="n">farbe</span> <span class="p">:</span><span class="o">=</span> <span class="mh">0FFH</span><span class="p">;</span> <span class="cm">(* Objektfarbe wird auf 0FF ("H" für hexadezimal) gesetzt *)</span>
<span class="n">punkt1</span><span class="p">.</span><span class="n">x</span> <span class="p">:</span><span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
<span class="n">punkt1</span><span class="p">.</span><span class="n">y</span> <span class="p">:</span><span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
<span class="n">punkt1</span><span class="p">.</span><span class="n">Zeichne</span> <span class="p">();</span>

<span class="kr">NEW</span> <span class="p">(</span><span class="n">linie1</span><span class="p">);</span>
<span class="n">linie1</span><span class="p">.</span><span class="n">farbe</span> <span class="p">:</span><span class="o">=</span> <span class="mh">07FH</span><span class="p">;</span> <span class="cm">(* Objektfarbe wird auf 07F ("H" für hexadezimal) gesetzt *)</span>
<span class="n">linie1</span><span class="p">.</span><span class="n">xStart</span> <span class="p">:</span><span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
<span class="n">linie1</span><span class="p">.</span><span class="n">yStart</span> <span class="p">:</span><span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
<span class="n">linie1</span><span class="p">.</span><span class="n">xEnde</span> <span class="p">:</span><span class="o">=</span> <span class="mi">2</span><span class="p">;</span>
<span class="n">linie1</span><span class="p">.</span><span class="n">yEnde</span> <span class="p">:</span><span class="o">=</span> <span class="mi">2</span><span class="p">;</span>
<span class="n">linie1</span><span class="p">.</span><span class="n">Zeichne</span> <span class="p">();</span>

<span class="kr">END</span> <span class="n">Vererbung1</span><span class="p">.</span>
</pre></div>
<p>Attribute, die nur einen Lesezugriff haben, können durch typengebundene Prozeduren (Methoden) verändert werden. Der Export entsprechender Identifizierer, die außerhalb der objekteigenen Module nur gelesen werden können, wird nicht durch <code>*</code>, sondern durch <code>-</code> gekennzeichnet. Beispiel:
</p>
<div class="mw-highlight mw-highlight-lang-componentpascal mw-content-ltr" dir="ltr"><pre><span></span> <span class="kr">MODULE</span> <span class="n">Vererbung2</span><span class="p">;</span>

<span class="kr">TYPE</span>

<span class="n">Objekt</span><span class="o">*</span> <span class="o">=</span> <span class="kr">POINTER</span> <span class="kr">TO</span> <span class="kr">RECORD</span> <span class="n">x</span><span class="o">-</span><span class="p">:</span> <span class="kt">INTEGER</span><span class="p">;</span> <span class="kr">END</span><span class="p">;</span> <span class="cm">(* Kommentar: außerhalb des Moduls "Vererbung2" ist kein direkter Schreibzugriff auf das Attribut "x" möglich *)</span>

<span class="kr">PROCEDURE</span> <span class="p">(</span><span class="n">objekt</span><span class="p">:</span> <span class="n">Objekt</span><span class="p">)</span> <span class="n">setzeX</span><span class="o">*</span> <span class="p">(</span><span class="n">wert</span><span class="p">:</span> <span class="kt">INTEGER</span><span class="p">),</span> <span class="kr">NEW</span><span class="p">;</span> <span class="cm">(* Kommentar: für den indirekten Schreibzugriff auf das Attribut "x" *)</span>
<span class="kr">BEGIN</span>
<span class="n">objekt</span><span class="p">.</span><span class="n">x</span> <span class="p">:</span><span class="o">=</span> <span class="n">wert</span><span class="p">;</span>
<span class="kr">END</span> <span class="n">setzeX</span><span class="p">;</span>

<span class="kr">END</span> <span class="n">Vererbung2</span><span class="p">.</span>
</pre></div>
<div class="mw-highlight mw-highlight-lang-componentpascal mw-content-ltr" dir="ltr"><pre><span></span> <span class="kr">MODULE</span> <span class="n">AnderesModul</span><span class="p">;</span>

<span class="kr">IMPORT</span> <span class="n">Vererbung2</span><span class="p">;</span>

<span class="kr">VAR</span>

<span class="n">objekt1</span><span class="p">:</span> <span class="n">Vererbung2</span><span class="p">.</span><span class="n">Objekt</span><span class="p">;</span>
<span class="n">int</span><span class="p">:</span> <span class="kt">INTEGER</span><span class="p">;</span>

<span class="kr">BEGIN</span>

<span class="kr">NEW</span> <span class="p">(</span><span class="n">objekt1</span><span class="p">);</span>
<span class="n">objekt1</span><span class="p">.</span><span class="n">setzeX</span> <span class="p">(</span><span class="mi">1</span><span class="p">);</span> <span class="cm">(* Kommentar: die Anweisung "objekt1.x&nbsp;:= 1" ist außerhalb des Moduls "Vererbung2" nicht möglich *)</span>
<span class="n">int</span> <span class="p">:</span><span class="o">=</span> <span class="n">objekt1</span><span class="p">.</span><span class="n">x</span><span class="p">;</span> <span class="cm">(* Kommentar: direkter Lesezugriff auf das Attribut ""x ist möglich *)</span>

<span class="kr">END</span> <span class="n">AnderesModul</span><span class="p">.</span>
</pre></div>
<div class="mw-heading mw-heading2"><h2 id="Literatur">Literatur</h2></div>
<ul><li>Karlheinz Hug: <i>Module, Klassen, Verträge. Ein Lehrbuch zur komponentenorientierten Softwarekonstruktion mit Component Pascal</i>. Vieweg Verlagsgesellschaft, 2001</li>
<li>J. Stanley Warford: <i>Computing Fundamentals - The Theory and Practice of Software Design with BlackBox Component Builder</i>. Vieweg, 2002</li>
<li>Markus Bautsch: <i>Cycles of Software Crises</i>. In: <a rel="nofollow" class="external text" href="http://www.enisa.europa.eu/publications/eqr/issues/eqr-q4-2007-vol.-3-no.-4">ENISA Quarterly on <i>Secure Software</i></a> (PDF; 2 MB)</li></ul>
<div class="mw-heading mw-heading2"><h2 id="Weblinks">Weblinks</h2></div>
<ul><li><a rel="nofollow" class="external text" href="https://blackboxframework.org">BlackBox Framework</a></li>
<li><a rel="nofollow" class="external text" href="http://www.zinnamturm.eu/">Sammlung von Quellen für Component Pascal</a></li>
<li><style data-mw-deduplicate="TemplateStyles:r261891140">
/* start https://de.wikipedia.org/ */


.mw-parser-output .webarchiv-memento a{color:inherit}


/* end https://de.wikipedia.org/ */
</style><a rel="nofollow" class="external text" href="https://web.archive.org/web/20150119165207/http://www.cfbsoftware.com/gpcp">Component Pascal Resources</a> (<span class="webarchiv-memento"><a href="Webarchivierung#Begrifflichkeiten" title="Webarchivierung">Memento</a></span> vom 19. Januar 2015 im <i><a href="Internet_Archive" title="Internet Archive">Internet Archive</a></i>)</li>
<li><a rel="nofollow" class="external text" href="https://web.archive.org/web/20120324161020/http://plas.fit.qut.edu.au/gpcp/Downloads.aspx">Gardens Point Component Pascal</a> (<span class="webarchiv-memento"><a href="Webarchivierung#Begrifflichkeiten" title="Webarchivierung">Memento</a></span> vom 24. März 2012 im <i><a href="Internet_Archive" title="Internet Archive">Internet Archive</a></i>)</li>
<li><a rel="nofollow" class="external text" href="http://www.lahini.de/">Tutorium Component Pascal</a></li>
<li><a rel="nofollow" class="external text" href="https://web.archive.org/web/20191021025943/http://www.oberon.ch/pdf/CP-Lang.pdf">Sprachdefinition (PDF; 221 kB)</a> (<span class="webarchiv-memento"><a href="Webarchivierung#Begrifflichkeiten" title="Webarchivierung">Memento</a></span> vom 21. Oktober 2019 im <i><a href="Internet_Archive" title="Internet Archive">Internet Archive</a></i>)</li>
<li><a rel="nofollow" class="external text" href="https://web.archive.org/web/19970227054638/http://www.oberon.ch/news/newnames.html">Ankündigung BlackBox 1.3 (1997)</a> (<span class="webarchiv-memento"><a href="Webarchivierung#Begrifflichkeiten" title="Webarchivierung">Memento</a></span> vom 27. Februar 1997 im <i><a href="Internet_Archive" title="Internet Archive">Internet Archive</a></i>)</li></ul>
<div class="mw-heading mw-heading2"><h2 id="Einzelnachweise">Einzelnachweise</h2></div>
<ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://blackboxframework.org/stable/blackbox-1.7.2-changes.html">Letzte Stable-Version BlackBox Framework</a></span>
</li>
</ol></div><!--htdig_noindex--><div><div class="zim-footer">
Dieser Artikel wurde von <a class="external text" title="Zuletzt bearbeitet am 2025-12-13" href="https://de.wikipedia.org/wiki/?title=Component_Pascal&amp;oldid=262392883">Wikipedia</a> herausgegeben. Der Text ist unter <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.de">Creative Commons Attribution-Share Alike 4.0</a> verfügbar, sofern nicht anders angegeben. Für die Mediendateien können zusätzliche Bedingungen gelten.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
<script src="./_webp_/webpHandler.js"></script>

</body></html>